package com.qiyi.cms.commons.dao.ibatis;

import com.qiyi.cms.commons.model.persistence.CmsCategoryResource;
import com.qiyi.cms.commons.model.persistence.CmsCategoryResourceExample;
import com.qiyi.cms.commons.model.persistence.CmsCategoryResourceWithBLOBs;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class CmsCategoryResourceDAOImpl extends SqlMapClientDaoSupport implements CmsCategoryResourceDAO {

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public CmsCategoryResourceDAOImpl() {
        super();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int countByExample(CmsCategoryResourceExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("CMS_CATEGORY_RESOURCE.countByExample", example);
        return count;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int deleteByExample(CmsCategoryResourceExample example) {
        int rows = getSqlMapClientTemplate().delete("CMS_CATEGORY_RESOURCE.deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int deleteByPrimaryKey(Integer id) {
        CmsCategoryResource _key = new CmsCategoryResource();
        _key.setId(id);
        int rows = getSqlMapClientTemplate().delete("CMS_CATEGORY_RESOURCE.deleteByPrimaryKey", _key);
        return rows;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public void insert(CmsCategoryResourceWithBLOBs record) {
        getSqlMapClientTemplate().insert("CMS_CATEGORY_RESOURCE.insert", record);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public void insertSelective(CmsCategoryResourceWithBLOBs record) {
        getSqlMapClientTemplate().insert("CMS_CATEGORY_RESOURCE.insertSelective", record);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    @SuppressWarnings("unchecked")
    public List<CmsCategoryResourceWithBLOBs> selectByExampleWithBLOBs(CmsCategoryResourceExample example) {
        List<CmsCategoryResourceWithBLOBs> list = getSqlMapClientTemplate().queryForList("CMS_CATEGORY_RESOURCE.selectByExampleWithBLOBs", example);
        return list;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    @SuppressWarnings("unchecked")
    public List<CmsCategoryResource> selectByExampleWithoutBLOBs(CmsCategoryResourceExample example) {
        List<CmsCategoryResource> list = getSqlMapClientTemplate().queryForList("CMS_CATEGORY_RESOURCE.selectByExample", example);
        return list;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public CmsCategoryResourceWithBLOBs selectByPrimaryKey(Integer id) {
        CmsCategoryResource _key = new CmsCategoryResource();
        _key.setId(id);
        CmsCategoryResourceWithBLOBs record = (CmsCategoryResourceWithBLOBs) getSqlMapClientTemplate().queryForObject("CMS_CATEGORY_RESOURCE.selectByPrimaryKey", _key);
        return record;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int updateByExampleSelective(CmsCategoryResourceWithBLOBs record, CmsCategoryResourceExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("CMS_CATEGORY_RESOURCE.updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int updateByExample(CmsCategoryResourceWithBLOBs record, CmsCategoryResourceExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("CMS_CATEGORY_RESOURCE.updateByExampleWithBLOBs", parms);
        return rows;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int updateByExample(CmsCategoryResource record, CmsCategoryResourceExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("CMS_CATEGORY_RESOURCE.updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int updateByPrimaryKeySelective(CmsCategoryResourceWithBLOBs record) {
        int rows = getSqlMapClientTemplate().update("CMS_CATEGORY_RESOURCE.updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int updateByPrimaryKey(CmsCategoryResourceWithBLOBs record) {
        int rows = getSqlMapClientTemplate().update("CMS_CATEGORY_RESOURCE.updateByPrimaryKeyWithBLOBs", record);
        return rows;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    public int updateByPrimaryKey(CmsCategoryResource record) {
        int rows = getSqlMapClientTemplate().update("CMS_CATEGORY_RESOURCE.updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by MyBatis Generator.
     * This class corresponds to the database table CMS_CATEGORY_RESOURCE
     *
     * @mbggenerated Thu Mar 20 19:06:29 CST 2014
     */
    protected static class UpdateByExampleParms extends CmsCategoryResourceExample {
        private Object record;

        public UpdateByExampleParms(Object record, CmsCategoryResourceExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}